import sys,time
import os

from Predict_6622Job import Predict_6622Job

def main(mode,bf_no,avg_iron_temp,avg_c_s_value,compute_slag_rate,avg_s_value,jiaotan_s,penchuimei_s):
    y1_pred_output = ''
    y2_pred_output = ''
    try:
        mode = int(mode)
        bf_no = int(bf_no)
        avg_iron_temp = float(avg_iron_temp)
        avg_c_s_value = float(avg_c_s_value)
        compute_slag_rate = float(compute_slag_rate)
        avg_s_value = float(avg_s_value)
        jiaotan_s = float(jiaotan_s)
        penchuimei_s = float(penchuimei_s)
        success_tmp = True
        msg = ''
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    except Exception as e:
        success_tmp = False
        msg = f'invalid_parameter_type--{str(e)}'
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    if success_tmp:
        y1_pred_output, y2_pred_output = Predict_6622Job(p_mode=mode, p_bf_no=bf_no, p_avg_iron_temp=avg_iron_temp, p_avg_c_s_value=avg_c_s_value, p_compute_slag_rate=compute_slag_rate, p_avg_s_value=avg_s_value, p_jiaotan_s=jiaotan_s, p_penchuimei_s=penchuimei_s).execute()
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
        success_tmp = True
    success = success_tmp
    message = msg
    timestamp = timestamp
    y1_pred_output = y1_pred_output
    y2_pred_output = y2_pred_output

    return success, message, timestamp, y1_pred_output, y2_pred_output
if __name__ == '__main__':
    mode = 1
    bf_no = 1
    avg_iron_temp = 1500
    avg_c_s_value = 121
    compute_slag_rate = 310
    avg_s_value = 29
    jiaotan_s = 0.69666
    penchuimei_s = 0.37750
    success, message, timestamp, y1_pred_output, y2_pred_output = main(mode,bf_no,avg_iron_temp,avg_c_s_value,compute_slag_rate,avg_s_value,jiaotan_s,penchuimei_s)
    print(success, message, timestamp, y1_pred_output, y2_pred_output)
